test: fix vacuous assertions in link_work_items and missing_tool#1644
Draft
github-actions[bot] wants to merge 1 commit into
Draft
test: fix vacuous assertions in link_work_items and missing_tool#1644github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Suite Reduction:
src/safe_outputs/link_work_items.rs+src/safe_outputs/missing_tool.rsWhat was wrong
Five validation tests used bare
assert!(result.is_err())— a vacuous pattern that confirms some error occurs but does not verify the error message. A regression that changed the error path (e.g. returning a different error for the wrong reason) would pass these tests silently.test_validation_rejects_zero_source_id(link_work_items): bareis_err(), no message check.test_validation_rejects_zero_target_id(link_work_items): bareis_err(), no message check.test_validation_rejects_same_ids(link_work_items): bareis_err(), no message check.test_validation_rejects_invalid_link_type(link_work_items): bareis_err(), no message check.test_params_requires_tool_name(missing_tool): bareis_err(), no message check.Changes
test_validation_rejects_zero_source_idlink_work_items.rsis_err()→unwrap_err()+"source_id must be positive"message checktest_validation_rejects_zero_target_idlink_work_items.rsis_err()→unwrap_err()+"target_id must be positive"message checktest_validation_rejects_same_idslink_work_items.rsis_err()→unwrap_err()+"source_id and target_id must be different"message checktest_validation_rejects_invalid_link_typelink_work_items.rsis_err()→unwrap_err()+"invalid link_type"message checktest_params_requires_tool_namemissing_tool.rsis_err()→.map()|().unwrap_err()+"tool_name"message checkVerification
cargo test: all tests pass ✅cargo check: no errors ✅Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comSee Network Configuration for more information.